
<div class="page" ng-controller="cspinquiryEditController">
    <div class="page-head">
        <h1 class="font-thin h4">{{inquiryName}}</h1>
    </div>
    <div class="page-body" id="cspInquiryEdit">
        <form name="orderForm" id="inquiryForm" class="form-validation form-horizontal" novalidate>
            <div class="page-body-banner"  ng-show="!editInquiryDis">
                <div class="banner-item-text" ng-show="!editInquiryDis">
                    <label class="pull-left">计划专员：</label> 
                    <label class="banner-text">{{plannerName}}</label>
                </div>
                <div class="banner-item" ng-show="!editInquiryDis">
                    <label class="pull-left  banner-label"><span class="text-danger">*&nbsp;</span>商务专员：</label>
                    <select class="form-control  banner-ipt tms-select" id="inquiryAdd_businessOfficerId" ng-disabled="editInquiryDis" ng-model="businessOfficerId" name="businessOfficerId" ng-options="x.id as x.realName for x in businessOfficerDropDown" required>
                        <option value="">请选择</option>
                    </select>
                </div>
                <div class="banner-item" ng-show="!editInquiryDis">
                    <label class="pull-left  banner-label"><span class="text-danger">*&nbsp;</span>客服专员：</label>
                    <select class="form-control  banner-ipt tms-select" id="inquiryAdd_customerServiceOfficerId" ng-disabled="editInquiryDis" ng-model="customerServiceOfficerId" name="customerServiceOfficerId" ng-options="x.id as x.realName for x in serviceOfficerIdDropDown" required>
                        <option value="">请选择</option>
                    </select>
                </div>                  
                <div class="banner-item">
                    <label class="pull-left  banner-label"><span class="text-danger">*&nbsp;</span>调度专员：</label>
                    <select class="form-control banner-ipt tms-select" id="inquiryAdd_dispatchOfficerId" ng-disabled="editInquiryDis" ng-model="dispatchOfficerId" name="dispatchOfficerId" ng-options="x.id as x.realName for x in dispatchOfficerDropDown" required>
                        <option value="">请选择</option>
                    </select>
                </div>
                <div class="banner-item banner-item-right" ng-show="!editInquiryDis">
                    <input id="inquiryAdd_urgency" name="responseTime" type="text" class="form-control tms-ipt banner-urgengcy-num" ng-model="responseTime" placeholder="请填写紧急程度" ng-disabled="editInquiryDis">
                    <select class="form-control  banner-urgency-unit tms-select" ng-model="responseTimeUnit" name="responseTimeUnit" ng-disabled="editInquiryDis" ng-options="x.value as x.text for x in urgencyUnitDropDown" required id="rgencyUnit">
                        <option value="">请选择</option>
                    </select>
                    <label class="banner-text">内回复</label>
                </div>
            </div>

            <div class="detail-client-info tms-flex"  ng-show="editInquiryDis">
                    <span class="client-name flex-1 text-left">{{clientName}}</span>
                    <span class="flex-1 text-right">
                        紧急程度：{{responseTime}}
                        <select class="tms-select select-responseTime ipt-1-1" ng-model="responseTimeUnit" name="responseTimeUnit" ng-disabled="editInquiryDis" ng-options="x.value as x.text for x in urgencyUnitDropDown" required id="rgencyUnit">
                            <option value="">请选择</option>
                        </select>
                        <label class="banner-text">内回复</label>                        
                    </span>
                </div>

            <div class="detail-block">
                <div class="block-head">基本信息</div>
                <table class="table-bordered detail-table">
                    <tr>
                        <td class="detail-td-left">子询价单编号 ：</td>
                        <td class="detail-td-right">
                            <label class=" text-left" ng-if="editInquiryDis">{{cspInquiryChildCode}}</label>
                            <label class="text-left text-danger" ng-if="!editInquiryDis">点击发布后系统自动生成</label>
                        </td>
                    </tr>
                    <tr ng-if="editInquiryDis">
                        <td class="detail-td-left">询价时间 ：</td>
                        <td class="detail-td-right">
                            <label class=" text-left" ng-if="editInquiryDis">{{cspInquiryTime}}</label>
                        </td>
                    </tr>
                    <tr ng-show="!editInquiryDis">
                        <td class="detail-td-left"><span class="text-danger">*&nbsp;</span>客户单位 ：</td>
                        <td class="detail-td-right">
                            <div class="ipt-3" angucomplete-alt id="client" placeholder="" pause="100" selected-object="clientSelect" remote-api-handler="searchClient" search-fields="name" title-field="name" minlength="1" input-class="form-control form-control-small input-sm" initial-value="clientName"
                                name="clientName" match-class="highlight" disable-input="editInquiryDis" required>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="detail-td-left"><span class="text-danger">*&nbsp;</span>发货计划人 ：</td>
                        <td class="detail-td-right">
                            <div class="ipt-3" angucomplete-alt id="consignor" placeholder="" pause="100" selected-object="consignorSelect" remote-api-handler="searchConsignor" search-fields="realName" title-field="realName" minlength="1" input-class="form-control form-control-small input-sm"
                                initial-value="customerName" name="customerName" match-class="highlight" disable-input="editInquiryDis" required>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="detail-td-left">发货人电话 ：</td>
                        <td class="detail-td-right">
                            <!-- <input id="inquiryAdd_consignorPhone" name="customerPhone" type="text" class="form-control input-sm" ng-model="customerPhone" placeholder="请填写发货人电话" disabled="disabled" required> -->
                            <label>{{customerPhone}}</label>
                        </td>
                    </tr>
                    <tr>
                        <td class="detail-td-left">总询价内容 ：</td>
                        <td class="detail-td-right td-textarea-container">
                            <textarea class="form-control input-sm detail-text-area " ng-model="content" placeholder="请填写总询价内容" ng-disabled="editInquiryDis" name="content"></textarea>
                        </td>
                    </tr>
                </table>
            </div>

            <div class="detail-block">
                <div class="block-head">线路信息</div>
                <table class="table-bordered detail-table">
                        <tr>
                            <td class="detail-td-left"><span class="text-danger">*&nbsp;</span>发货地址 ：</td>
                            <td class="detail-td-right">
                                <tms-address class="pull-left" city-list="shipCityList" area-list="shipAreaList" province="originProvince" city="originCity" area="originCounty" required="true" ischecked="true">
                                </tms-address>
                                <input id="inquiryAdd_startAddress" name="originDetails" type="text" class="form-control tms-ipt ipt-4" ng-disabled="editInquiryDis" ng-model="originDetails" placeholder="请填写详细地址" required>
                            </td>
                        </tr>
                        <tr>
                            <td class="detail-td-left"><span class="text-danger">*&nbsp;</span>送货地址 ：</td>
                            <td class="detail-td-right">
                                <tms-address class="pull-left" city-list="deliverCityList" area-list="deliverAreaList" province="destinationProvince" city="destinationCity" area="destinationCounty" ischecked="true" required="true">
                                </tms-address>
                                
                                <input id="inquiryAdd_destinationDetails" name="destinationDetails" type="text" ng-disabled="editInquiryDis" class="form-control input-sm tms-ipt ipt-4" ng-model="destinationDetails" placeholder="请填写详细地址" required>
                                
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2"   >
                                <div class="td-multi-col ">
                                    <div class="td-flex flex-1">
                                        <span class="td-title td-title-first"><span class="text-danger">*&nbsp;</span>预计发货时间 ：</span>
                                        <span class="td-content">
                                            <input id="dataTime" name="foreArrivalTime" datetimepicker plugintype="datetime" ng-disabled="editInquiryDis" ng-model="foreArrivalTime" placeholder="预计发货时间" class="form-control tms-ipt ipt-6 ipt-time" type="text" required />
                                        </span>
                                    </div>
                                    <div class="td-flex flex-1">
                                        <span class="td-title"><span class="text-danger">*&nbsp;</span>预计到货时间 ：</span>
                                        <span class="td-content">
                                            <input id="dataTimeEnd" name="foreDeliveryTime" datetimepicker plugintype="datetime" ng-disabled="editInquiryDis" ng-model="foreDeliveryTime" placeholder="预计到货时间" class="form-control tms-ipt ipt-6 ipt-time" type="text" required ui-validate=" '$value>foreArrivalTime' " ui-validate-watch=" 'foreArrivalTime' "
                                            />
                                        </span>
                                    </div>
                                    <div class="td-flex flex-2">
                                        <span class="td-title">里程数 ：</span>
                                        <span class="td-content">
                                            <input id="inquiryAdd_mileage" name="mileage" type="text" class="form-control input-sm tms-ipt ipt-3" ng-disabled="editInquiryDis" ng-pattern="/^[+]?\d+\.?\d*$/" ng-model="mileage" placeholder="请填写里程数">
                                            <label class="control-label">公里</label>
                                        </span>
                                    </div>
                                </div>
                                
                            </td>
                            
                        </tr>
                        
                    </table>
            </div>

            <div class="detail-block">
                <div class="block-head">货物信息</div>
                <table class="table-bordered detail-table">
                    <tr>
                        <td>
                            <div class="td-multi-col ">
                                <div class="td-flex flex-1">
                                    <span class="td-title td-title-first"><span class="text-danger">*&nbsp;</span>货物类别 ：</span>
                                    <span class="td-content">
                                        <select id="inquiryAdd_goodsTypeName" class="form-control input-sm tms-inline tms-select ipt-6" ng-model="goodsTypeId" ng-disabled="editInquiryDis" name="goodsTypeId" ng-change="goodsTypeSelect()" ng-options="x.id as x.name for x in goodsTypeDropDown" required>
                                            <option value="">请选择</option>
                                        </select>
                                    </span>
                                </div>
                                <div class="td-flex flex-1">
                                    <span class="td-title"><span class="text-danger">*&nbsp;</span>货物名称 ：</span>
                                    <span class="td-content">
                                        <div class="tms-inline tms-autocomplete ipt-6" angucomplete-alt id="goodsId" placeholder="" pause="100" selected-object="onGoodsNameSelected" remote-api-handler="onGoodsNameAutoComplate" search-fields="name" title-field="name" minlength="0" input-class="form-control form-control-small input-sm"
                                            initial-value="goodsName" match-class="highlight" field-required="true" input-name="goodsId" auto-match="true" focus-first="true">
                                        </div>
                                    </span>
                                </div>
                                <div class="td-flex flex-2">
                                    <span class="td-title"><span class="text-danger">*&nbsp;</span>货物数量 ：</span>
                                    <span class="td-content">
                                        <input id="inquiryAdd_goodsQuantity" name="quantityOfGoods" type="text" ng-pattern="/^[0-9]+(\.[0-9]{1,4})?$/" ng-disabled="editInquiryDis" class="form-control tms-ipt ipt-1" ng-model="quantityOfGoods" placeholder="请填写货物数量" required>
                                        <select class="form-control tms-inline tms-select ipt-2" id="inquiryAdd_goodsQuantityUnit" ng-model="goodsUnit" name="goodsUnit" ng-disabled="editInquiryDis" ng-options="x.value as x.text for x in goodsQuantityUnitDropDown" required>
                                            <option value="">请选择</option>
                                        </select>
                                    </span>
                                </div>
                            </div>
                        </td>
                        
                    </tr>
                    
                    
                </table>
            </div>
            <div class="detail-block">
                <div class="block-head">所需车辆信息</div>
                <table class="table-bordered detail-table">
                    <tr>
                        <td>
                            <div class="td-multi-col ">
                                <div class="td-flex flex-1">
                                    <span class="td-title td-title-first"><span class="text-danger">*&nbsp;</span>所需车辆 ：</span>
                                    <span class="td-content">
                                        <select id="inquiryAdd_carType" class="form-control input-sm tms-inline tms-select ipt-6" ng-model="vehicleType" name="vehicleType" ng-disabled="editInquiryDis" ng-options="x.value as x.text for x in carTypeDropDown" required>
                                            <option value="">请选择</option>
                                        </select>
                                    </span>
                                </div>
                                <div class="td-flex flex-1">
                                    <span class="td-title"><span class="text-danger">*&nbsp;</span>所需车长 ：</span>
                                    <span class="td-content">
                                        <select id="inquiryAdd_carLength" class="form-control input-sm tms-inline tms-select ipt-6" ng-model="carLength" name="carLength" ng-disabled="editInquiryDis" ng-options="x.value as x.text for x in carLengthDropDown" required>
                                            <option value="">请选择</option>
                                        </select>
                                    </span>
                                </div>
                                <div class="td-flex flex-1">
                                    <span class="td-title"><span class="text-danger">*&nbsp;</span>承运方式 ：</span>
                                    <span class="td-content">
                                        <select id="inquiryAdd_carrierCategory" class="form-control input-sm tms-inline tms-select ipt-6"  ng-model="carriageWay" ng-disabled="editInquiryDis" name="carrierCategory" ng-options="x.value as x.text for x in carrierCategoryDropDown" required>
                                            <option value="">请选择</option>
                                        </select>
                                    </span>
                                </div>
                                <div class="td-flex flex-1">
                                    <span class="td-title">装车效果 ：</span>
                                    <span class="td-content">
                                        <input id="inquiryAdd_loadingEffect" name="loadingEffect" type="text" class="form-control input-sm  tms-inline ipt-6" ng-disabled="editInquiryDis" ng-model="loadingEffect" placeholder="请填写装车效果">
                                    </span>
                                </div>
                            </div>
                        </td>
                        
                    </tr>
                    
                    
                </table>
            </div>
            <div class="detail-block">
                <div class="block-head">附件信息</div>
                <table class="table-bordered detail-table">
                    <tr>
                        <td class="detail-td-left">附件上传 ：</td>
                        <td class="detail-td-right" ng-if="!editInquiryDis">    
                            <input class="tms-ipt-file" id="attachmentUploader" name="attachmentUploader" type="file" file-read uploader="attachmentUploader" multiple />
                            <button class="btn tms-btn tms-btn-select-file" onClick="attachmentUploader.click()">选择文件</button>
                            <button id="inquiryAdd_uploadAll" class="btn tms-btn tms-btn-uploadAll" ng-click="attachmentUploader.uploadAll()" ng-if="!editInquiryDis" ng-disabled="!attachmentUploader.getNotUploadedItems().length">
                                    全部上传
                            </button>
                        </td>
                    </tr>
                    <tr>
                        <td class="detail-td-left"></td>
                        <td class="detail-td-right detail-attachment-container">
                            <table class="table-bordered attachment-table detail-attachment-table" ng-if="attachmentUploader.queue.length">
                                <thead>
                                    <tr>
                                        <th width="20%">名称</th>
                                        <th width="20%">大小</th>
                                        <th width="20%">进度</th>
                                        <th width="20%">状态</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr ng-repeat="item in attachmentUploader.queue">
                                        <td class="attachment-table-filename">
                                            <strong>{{item.fileName|| item.fileName }}</strong>
                                        </td>
                                        <td class="text-center" nowrap>{{ item.fileSize/1024/1024|number:2 }} MB</td>
                                        <td class="text-center">
                                            <div class="progress" style="margin: 0 auto; width:60px;">
                                                <div class="progress-bar" role="progressbar" ng-style="{ 'width': item.progress + '%' }"></div>
                                            </div>
                                        </td>
                                        <td class="text-center">
                                            <span ng-show="item.isSuccess"><i class="glyphicon glyphicon-ok"></i></span>
                                            <span ng-show="item.isCancel"><i class="glyphicon glyphicon-ban-circle"></i></span>
                                            <span ng-show="item.isError"><i class="glyphicon glyphicon-remove"></i></span>
                                        </td>
                                        <td class="text-center" nowrap>
                                            <button id="inquiryAdd_upload" class="btn tms-btn attachment-btn-upload" ng-if="!editInquiryDis" ng-click="attachmentUploader.upload(item)" ng-disabled="item.isReady || item.isUploading || item.isSuccess">
                                                    上传
                                            </button>
                                            <button id="inquiryAdd_onDelete" class="btn tms-btn attachment-btn-delete" ng-if="!editInquiryDis" ng-click="attachmentUploader.onDelete(item)">
                                                    删除
                                            </button>
                                            <button type="button" class="btn tms-btn attachment-btn-download" ng-click="attachmentUploader.onDownload(item)" id="download">
                                                下载
                                            </button>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </td>
                    </tr>
                    
                    
                </table>
            </div>

            <div class="detail-block">
                <div class="block-head">备注信息</div>
                <table class="table-bordered detail-table detail-remarks">
                    <tr>
                        <td class="detail-td-left">
                            备注：
                        </td>
                        <td class="detail-td-right td-textarea-container">
                            <textarea class="form-control detail-text-area"  style="height:80px" ng-disabled="editInquiryDis" ng-model="attachmentRemarks" placeholder="请填写备注" name="attachmentRemarks"></textarea>
                        </td>
                        
                    </tr>
                    
                    
                </table>
            </div>

            <div class="detail-btn-area text-center detail-bottom">
                <button id="inquiryAdd_release" class="btn tms-btn tms-btn-release" ng-if="!editInquiryDis" ng-disabled="saveDis" ng-click="cspinquirySaveEdit()">询价发布</button>
                <button id="inquiryAdd_cancel" ui-sref="app.inquiry.external_inquiryNew({name:'inquiry'})" class="btn tms-btn tms-btn-back ">返回</button>
            </div>



        </form>
    </div>
</div>


